package com.fafu;

import com.mysql.jdbc.Driver;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;

public class Connection01 {
    public static void main(String[] args) throws Exception{
        //加载驱动
        Class.forName("com.mysql.cj.jdbc.Driver");
        //创建连接
        Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/student?serverTimezone=GMT%2B8&useSSL=false&characterEncoding=UTF-8","root","root");
        System.out.println(connection);
    }
}
